package edu.bbu.license.client.android.services.user;

import android.content.Intent;
import edu.bbu.license.client.android.application.MainApplication;
import edu.bbu.license.client.android.services.BaseServiceProvider;
import edu.bbu.license.client.android.services.user.worker.AutentificationService;
import edu.bbu.license.client.android.services.user.worker.SimpleAutentificationService;

public class UserServiceProvider extends BaseServiceProvider {

	private static AutentificationService autentificationService = new SimpleAutentificationService();
	
	@Override
	public int onStartCommand(Intent intent, int flags, int startId) {
		return START_STICKY;
	}
	
	public AutentificationService getAutentificationService() {		
		startService();		
		return autentificationService;
	}
	
	@Override
	protected void startService() {
		MainApplication mainApplication = MainApplication.getInstance();
		mainApplication.startService(new Intent(mainApplication, UserServiceProvider.class));
	}
}
